import request from '@/utils/request'

/** 井API开始 */

export function addSysWell(data) {
  return request({
    url: '/api/base/syswell/addSysWell',
    method: 'post',
    needLoading: true,
    data
  })
}

export function findSysWellAll(data) {
  return request({
    url: '/api/base/syswell/findSysWellAll',
    method: 'get',
    params: {
      dictType: data
    }
  })
}
export function findWellListByCondition(data) {
  return request({
    url: '/api/base/syswell/findWellListByCondition',
    method: 'get',
    params: data
  })
}

export function findWellAreaNameByCondition(data) {
  return request({
    url: '/api/base/syswell/findWellAreaNameByCondition',
    method: 'get',
    params: data
  })
}

export function updateSysWell(data) {
  return request({
    url: '/api/base/syswell/updateSysWell',
    method: 'put',
    needLoading: true,
    data
  })
}

export function addSysArea(data) {
  return request({
    url: '/api/base/sysarea/addSysArea',
    method: 'post',
    needLoading: true,
    data
  })
}
export function addSysAreas(data) {
  return request({
    url: '/api/base/sysarea/addSysAreas',
    method: 'post',
    needLoading: true,
    data
  })
}
export function addSysWells(data) {
  return request({
    url: '/api/base/syswell/addSysWells',
    method: 'post',
    needLoading: true,
    data
  })
}

export function updateSysArea(data) {
  return request({
    url: '/api/base/sysarea/updateSysArea',
    method: 'put',
    needLoading: true,
    data
  })
}
export function findSysAreaAll(query) {
  return request({
    url: '/api/base/sysarea/findSysAreaAll',
    method: 'get',
    params: query
  })
}

export function queryRoleName() {
  return request({
    url: '/api/admin/sysrole/queryRoleName',
    method: 'get'
  })
}

export function querySysOrgTree() {
  return request({
    url: '/api/admin/sysorg/querySysOrgTree',
    method: 'get'
  })
}
export function addSysProdOrg(data) {
  return request({
    url: '/api/base/sysprodorg/addSysProdOrg',
    method: 'post',
    needLoading: true,
    data
  })
}
export function findSysProdOrgAll(query) {
  return request({
    url: '/api/base/sysprodorg/findSysProdOrgAll',
    method: 'get',
    params: query
  })
}
export function updateProdWellGeologies(data) {
  return request({
    url: '/api/proc/prodwellgeology/updateProdWellGeologies',
    method: 'post',
    needLoading: true,
    data
  })
}
export function updateProdWellExploits(data) {
  return request({
    url: '/api/proc/prodwellexploit/updateProdWellExploits',
    method: 'post',
    needLoading: true,
    data
  })
}

/** 用户API结束 */
/** 菜单API开始 */

export function querySysMenu(query) {
  return request({
    url: '/api/admin/sysmenu/querySysMenu',
    method: 'get',
    params: query
  })
}

export function addSysMenu(data) {
  return request({
    url: '/api/admin/sysmenu/addSysMenu',
    method: 'post',
    needLoading: true,
    data
  })
}

export function updateSysMenu(data) {
  return request({
    url: '/api/admin/sysmenu/updateSysMenu',
    method: 'put',
    needLoading: true,
    data
  })
}

export function deleteSysMenu(data) {
  return request({
    url: '/api/admin/sysmenu/deleteSysMenu',
    method: 'post',
    params: {
      id: data
    }
  })
}

export function querySysMenuTree() {
  return request({
    url: '/api/admin/sysmenu/querySysMenuTree',
    method: 'get'
  })
}

export function queryMenuButtonCheckbox() {
  return request({
    url: '/api/admin/sysmenu/queryMenuButtonCheckbox',
    method: 'get'
  })
}

export function queryCheckedMenuButton(data) {
  return request({
    url: '/api/admin/sysmenu/queryCheckedMenuButton',
    method: 'get',
    params: {
      menuCode: data
    }
  })
}
// 查询用户名的下拉框数据
export function queryUsername() {
  return request({
    url: '/api/base/syswell/queryUsername',
    method: 'get'
  })
}
// 查询数据字典类型数据列表
export function getSysDictByType(data) {
  return request({
    url: '/api/admin/sysdict/getSysDictByType',
    method: 'get',
    params: {
      dictType: data
    }
  })
}
/** 菜单API结束 */

